import Vue from 'vue'
import App from './App.vue'
import router from './router'
import './plugins/element.js'
import './assets/css/global.css'
import './assets/fonts/iconfont.css'
import axios from 'axios'

axios.defaults.baseURL = 'http://api.leyou.com/api' // 配置请求基础路径
axios.defaults.withCredentials = true   //允许跨域携带cookie
Vue.prototype.$http = axios
Vue.config.productionTip = false

// 解析promise对象
axios.loadData = async function (url) {
  const resp = await axios.get(url);
  return resp.data;
}

new Vue({
  router,
  render: h => h(App),
}).$mount('#app')
